<?php
	session_start();
	if(!array_key_exists("role", $_SESSION) || $_SESSION['role'] != "admin"){
		header("Location: /index.php");
		exit;
	}
	
	$conn = mysql_connect("", "piedu_user", "q&&^%@8ezO8+");
	mysql_select_db("piedu_db");
	
	$sql = "SELECT * FROM orderline WHERE id = {$_GET['id']}";
	$query = mysql_query($sql, $conn);
	if(mysql_num_rows($query) == 0){
		header("Location: manage_orders.php?action=notfound");
		exit;
	}
	$order = mysql_fetch_assoc($query);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Pie Education | View Order</title>
<Meta name="Author" content="Rob Keller">
<Meta name="Publisher" content="Aaron Aceves">
<Meta name="Robots" content="NOINDEX,NOFOLLOW">
<Meta name="Content-Language" content="English">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
<link rel="stylesheet" href="../css/style.css" />
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="80" bgcolor="#FF8C00" align="center"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><a href="index.php"><img src="../images/logo.png" alt="Return to Index" width="250" height="70" border="0" title="pie.edu an E-Learning Network" /></a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" bgcolor="#000000" align="center"><a href="index.php" class="global-nav-menu" style="color:#FFF">Home </a><a href="coupons.php" class="global-nav-menu" style="color:#FFF">Manage Coupons </a><a href="promotions.php" class="global-nav-menu" style="color:#FFF">Manage Promotions </a><a href="items.php" class="global-nav-menu" style="color:#FFF">Manage Items</a><a href="manage_orders.php" class="global-nav-menu" style="color:#FFF">Manage Orders</a><a href="transactions.php" class="global-nav-menu" style="color:#FFF">Transactions Details</a><a href="#" class="global-nav-menu" style="color:#FFF">Another Menu</a><a href="#" class="global-nav-menu" style="color:#FFF">Another Menu</a><a href="#" class="global-nav-menu" style="color:#FFF">Another Menu</a><a href="/logout.php" class="global-nav-menu" style="color:#FFF">Logout</a></td>
  </tr>
  <tr>
    <td height="500" bgcolor="#FFFFFF"><table width="980" border="0" align="center" cellpadding="4" cellspacing="4">
      <tr>
        <td height="30" colspan="4" align="center" style="color:#FFF">&nbsp;</td>
      </tr>
      <tr>
        <td height="30" colspan="4" align="center" bgcolor="#000000" style="color:#FFF"><strong>Order Details</strong></td>
        </tr>
      <tr>
        <td width="20%" align="right" bgcolor="#F0F0F0"><strong>Order Number</strong></td>
        <td width="30%"><?php echo $order['order_number'] ?></td>
        <td width="20%" align="right" bgcolor="#F0F0F0"><strong>Order Code</strong></td>
        <td width="30%"><?php echo $order['code'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Buyer</strong></td>
        <td><?php echo $order['username'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Item SKU</strong></td>
        <td><?php echo $order['sku'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Item Description</strong></td>
        <td><?php echo $order['description'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Quantity</strong></td>
        <td><?php echo $order['quantity'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Price</strong></td>
        <td><?php echo $order['price'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Payment Method</strong></td>
        <td><?php echo $order['payment_method'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Tax</strong></td>
        <td><?php echo $order['tax'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Shipping Cost</strong></td>
        <td><?php echo $order['shipping'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Sub Total</strong></td>
        <td><?php echo $order['subtotal'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Shipping Method</strong></td>
        <td><?php echo $order['shipmode'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Order Date</strong></td>
        <td><?php echo $order['order_date'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Order Status</strong></td>
        <td><?php echo $order['order_status'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Order Delivered</strong></td>
        <td><?php echo $order['completed_on'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Shipping Notes</strong></td>
        <td><?php echo $order['ship_note'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>IP</strong></td>
        <td><?php echo $order['ip'] ?></td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="30" colspan="2" align="center" bgcolor="#000000" style="color:#FFF"><strong>Billing Information</strong></td>
        <td colspan="2" align="center" bgcolor="#000000" style="color:#FFF"><strong>Shipping Information</strong></td>
        </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>First Name</strong></td>
        <td><?php echo $order['b_fname'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>First Name</strong></td>
        <td><?php echo $order['s_fname'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Last Name</strong></td>
        <td><?php echo $order['b_lname'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Last Name</strong></td>
        <td><?php echo $order['s_lname'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Address</strong></td>
        <td><?php echo $order['b_address'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Address</strong></td>
        <td><?php echo $order['s_address'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>City</strong></td>
        <td><?php echo $order['b_city'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>City</strong></td>
        <td><?php echo $order['s_city'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>State</strong></td>
        <td><?php echo $order['b_state'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>State</strong></td>
        <td><?php echo $order['s_state'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Zip Code</strong></td>
        <td><?php echo $order['b_zip'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Zip Code</strong></td>
        <td><?php echo $order['s_zip'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Country</strong></td>
        <td><?php echo $order['b_country'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Country</strong></td>
        <td><?php echo $order['s_country'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Phone Day</strong></td>
        <td><?php echo $order['b_phone_day'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Phone Day</strong></td>
        <td><?php echo $order['s_phone_day'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Phone Night</strong></td>
        <td><?php echo $order['b_phone_night'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Phone Night</strong></td>
        <td><?php echo $order['s_phone_night'] ?></td>
      </tr>
      <tr>
        <td align="right" bgcolor="#F0F0F0"><strong>Fax</strong></td>
        <td><?php echo $order['b_fax'] ?></td>
        <td align="right" bgcolor="#F0F0F0"><strong>Fax</strong></td>
        <td><?php echo $order['s_fax'] ?></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="80" bgcolor="#FF9933" align="center"><a href="../index.php" class="bottom-general-menu" style="color:#FFF">Home</a> <a href="../platform.php" class="bottom-general-menu" style="color:#FFF">Platform</a> <a href="../piephone.php" class="bottom-general-menu" style="color:#FFF">Pie Phone</a> <a href="../company_training.php" class="bottom-general-menu" style="color:#FFF">Company Training</a> <a href="../jobs.php" class="bottom-general-menu" style="color:#FFF">Jobs</a> <a href="../press.php" class="bottom-general-menu" style="color:#FFF">Press</a> <a href="../community/" class="bottom-general-menu" style="color:#FFF">Community</a> <a href="../mobile.php" class="bottom-general-menu" style="color:#FFF">Mobile</a> <a href="support/" class="bottom-general-menu" style="color:#FFF">Help</a> <a href="../blog/" class="bottom-general-menu" style="color:#FFF">Blogs</a> <a href="../forums/" class="bottom-general-menu" style="color:#FFF">Forums</a><a href="../about.php" class="bottom-general-menu" style="color:#FFF">About</a> <a href="../terms.html" class="bottom-general-menu" style="color:#FFF">Terms of Use</a> <a href="../privacy.html" class="bottom-general-menu" style="color:#FFF">Privacy Policy</a> <a href="../contact-us.php" class="bottom-general-menu" style="color:#FFF">Contact Us</a></td>
  </tr>
</table>
</body>
</html>